import com.sun.security.jgss.GSSUtil;

import java.util.Scanner;

public class test_4_5 {
    public static void main6(String[] args) {
        int x = 10;
        int y = 20;
        if (x == 10)
            if(y == 10);
        else
            System.out.println("hehe");
    }
    public static int Fac2(int n){
        int a = 1;
        int b = 1;
        int c = 0;
        if (n <= 2){
            return b;
        }else{
            for (int i = 0; i < n - 2; i++){
                c = a + b;
                a = b;
                b = c;
            }
            return c;
        }
    }
    public static int Fac1(int n){
        if (n > 0 && n <= 2){
            return 1;
        }else{
            return Fac1(n - 1) + Fac1(n - 2);
        }
    }
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("请输入N的值:");
        int n = input.nextInt();
        int ret = Fac1(n);
        System.out.print(ret);
    }
    public static int everOneOfNumber(int n){
        if (n > 0) {
            return (n % 10) + everOneOfNumber(n / 10);
        }else{
            return 0;
        }
    }
    public static void main4(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = 0;
        while (true){
            System.out.print("请输入一个非负整数：");
            n = input.nextInt();
            if (n < 0){
                System.out.println("输入错误！");
            }else{
                break;
            }
        }
        int ret = everOneOfNumber(n);
        System.out.println(ret);
    }
    public static int sum(int n){
        if (n == 1){
            return 1;
        }else{
            return n + sum(n - 1);
        }
    }
    public static void main3(String[] args) {
        int n = 10;
        int ret = sum(n);
        System.out.println(ret);
    }
    public static void number(int n){
        if (n > 0){
            number(n / 10);
            System.out.print(n % 10 + " ");
        }
    }
    public static void main2(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("请输入一个数：");
        int n = input.nextInt();
        number(n);
    }
    public static int factor(int n){
        if (n == 1){
            return 1;
        }else{
            return n * factor(n - 1);
        }
    }

    public static void main1(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("请输入N的值:");
        int n = input.nextInt();
        int ret = factor(n);
        System.out.println("N的阶乘为：" + ret);
    }
}
